/**
 * 
 */
package edu.cse5311.impl;

import java.io.FileOutputStream;
import java.io.IOException;

import edu.cse5311.constants.Constants;

/**
 * @author Karthik MG/ Shwetha Narayan
 * This class is used to write the output details to an output file
 *
 */
public class Output {
	
	/**
	 * This function takes in details from every operation and writes the 
	 * specified operation details to the output file in the file path specified
	 * 
	 * @param dataToFile
	 */

	public void outputDetailsToFile(String dataToFile) {
		try {
			
			FileOutputStream fos = new FileOutputStream(Constants.FILEPATH
					+ Constants.OUTPUTFILENAME, true);

			fos.write(dataToFile.getBytes());
			String nextLine = System.getProperty("line.separator");
			fos.write(nextLine.getBytes());

			fos.close();

		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
